#!/bin/sh

COMPRESS=./compress
DECOMPRESS=./decompress
CSTATS=cstats.txt
DSTATS=dstats.txt

COMP=`date +%s`.cmp
DEFL=`date +%s`.tmp


for i in test_*; do
echo "Starting test with $i"
echo "Debut compression"
$COMPRESS $i $COMP
isize=`stat -c %s $i`
osize=`stat -c %s $COMP`
echo "Fin compression $i vers $COMP"
echo $isize ' ' $osize >> $CSTATS
echo
echo "Debut decompression"
$DECOMPRESS $COMP $DEFL
echo "Fin decompression $i vers $COMP"
echo
echo "Je mesure la difference..."
diff $i $DEFL && echo "Super, aucune difference" || echo "Oups $i est different de $i.t"
rm -i $DEFL $COMP

done
